package com.dorm.cj.创建型.prototype;

public class Plane implements Cloneable {

    private int x;

    private int y;

    private Fly fly;

    public Plane(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Fly getFly() {
        return fly;
    }

    public void setFly(Fly fly) {
        this.fly = fly;
    }

    @Override
    public String toString() {
        return "Plane{" +
                "x=" + x +
                ", y=" + y +
                ", fly=" + fly.getName() +
                '}';
    }

    @Override
    public Plane clone() throws CloneNotSupportedException {
        return (Plane) super.clone();
    }
}
